package com.example.demo99.Mapper;

import com.example.demo99.Domian.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
//  @Select("select * from class_info where xueyuan like concat('%',#{xueyuan},'%')")
//  List<User> selectUser(String User);

  @Select("select * from class_info where id=#{id}")
  User al(int id);

  @Delete("delete from class_info where id=#{id}")
  int delete(int id);



  @Update("UPDATE `suqi`.`class_info` SET  `class_name`=#{className}, `xueyuan`=#{xueyuan}, `number`=#{number} WHERE (`id`=#{id})")
  int edit(@Param("id") Integer id,@Param("className") String className,@Param("xueyuan") String xueyuan,@Param("number") int number);

  @Insert("INSERT INTO `suqi`.`class_info` ( `class_name`, `xueyuan`, `number`) VALUES ( #{className},  #{xueyuan},  #{number});")
  int add(String className, String xueyuan, int number);


  @Select("select * from class_info where xueyuan like concat('%',#{xueyuan},'%')")
  List<User> getAll(String xueyuan);


//@Update("UPDATE `suqi`.`class_info` SET  `class_name`=#{class_name}, `xueyuan`='as', `number`='23' WHERE (`id`='7')")
//  int edit(@Param("id")  Integer id,@Param("class_name")  String class_name, @Param("xueyuan") String xueyuan, @Param("number") int number);












}
